# coding=utf8
__author__ = 'lijian'

import platform

if platform.machine()=="armv5tejl":
    CONFIG_PATH = "/work/config"

    RUNTIME_PATH = "/work/runtime"

    PLC_SERIAL = {"port": "/dev/ttySP2", "baudrate": 9600, "stopbits": 1, "parity": 'E'}

    RTU_SERIAL = {"port": "/dev/ttySP1", "baudrate": 9600, "stopbits": 1, "parity": 'E'}
else:
    CONFIG_PATH = "./config"

    RUNTIME_PATH = "./runtime"

    PLC_SERIAL = {"port": "/dev/ttys001", "baudrate": 9600, "stopbits": 1, "parity": 'E'}

    RTU_SERIAL = {"port": "/dev/ttySP0", "baudrate": 9600, "stopbits": 1, "parity": 'E'}



CONFIG_FILE = RUNTIME_PATH + "/config.xml"

LAMPS_FILE_PATH = RUNTIME_PATH + "/lamps.xml"

LAMPS_AUTO_TASK_PATH = RUNTIME_PATH + "/autoCtrlTask.xml"

PLAN_TASK_PATH = RUNTIME_PATH + "/planTask.xml"

RTU_RECORD_PATH = RUNTIME_PATH + "/rtuActionRecord.xml"

RTU_TELE_TYPE_DICT = RUNTIME_PATH + "/teleTypeDict.py"

RTU_ANALOG_LIMIT_DICT = RUNTIME_PATH + "/analogLimitDict.py"

RTU_ACTION_RECORD = RUNTIME_PATH + "/rtuActionReord.py"

EVENT_RECORD = RUNTIME_PATH + "/event.xml"

UPGRADE_INFO=RUNTIME_PATH + "/upgradeInfo.py"

AMP_FILE=RUNTIME_PATH + "/amp"


LAMP_HISTORY_INTERVAL = 1 * 60

version = 1.0

termInfo = {
    "producerId": "0001",  # 厂商代号
    "productId": "0016",  # 厂商设备编号
    "softwareVersion": "0001",  # 终端软件版本号
    "softwareReleaseDate": "2014-12-15",  # 终端软件发布日期
    "capacityCode": "1",  # 终端配置容量信息码
    "protocolVersion": "0102",  # 终端通信协议版本号
    "hardwareVersion": "0001",  # 终端硬件版本号
    "plcModelType": "aem",  # 载波芯片型号
    "hardwareReleaseDate": "2014-12-15",  #终端硬件发布日期
    "haveRelay": 1,  #是否有中间继电器
    "termType": 3,  #终端设备类型
    "producedDate": "2014-12-15"  #生产日期
}